package com.lqian.demo02.part5.dao;

import com.lqian.demo02.part5.common.BaseDao;
import com.lqian.demo02.part5.pojo.User;

import java.sql.SQLException;
import java.util.List;

/**
 * @author：Melody_LQ
 * @time：2022/7/14 6:14 下午
 */
public class UserDaoImpl extends BaseDao<User> implements UserDao{


    @Override
    public int addUser(User user) throws SQLException {
        String sql = "insert into users(name,password,email,birthday) values(?,?,?,?)";
        Object[] params = {user.getName(),user.getPassword(),
                user.getEmail(),user.getBirthday()};
        return execute(sql,params);
    }

    @Override
    public int updateUser(User user, int id) {

        return 0;
    }

    @Override
    public int delUserById(int id) {
        return 0;
    }

    @Override
    public User selectUserById(int id) {
        return null;
    }

    @Override
    public List<User> selectAllUsers() {
        return null;
    }
}
